package com.vhall.component.controller.vote.facade;


import com.vhall.component.entity.page.vo.PageVO;
import com.vhall.component.entity.vote.vo.*;
import com.vhall.component.entity.vote.vo.room.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 *
 * 投票
 * @author longzhen.gong
 * @date 2021/7/7 11:47
 */
@FeignClient(value = "VoteRoomFacade", path = "/v4/vote")
public interface VoteRoomFacade {

    /**
     * 创建投票
     *
     * @param reqVO
     * @return
     */
    @PostMapping("/create")
    VotesCreateRspVO create(@Validated VotesCreateRoomReqVO reqVO);

    /**
     * 更新投票
     *
     * @param repVO
     * @return
     */
    @PostMapping("/update")
    VotesUpdateRspVO update(@Validated VotesUpdateRoomRepVO repVO);

    /**
     * 查询列表
     *
     * @param repVO
     * @return
     */
    @GetMapping("/list")
    PageVO<VotesListRspVO> list(@Validated VotesListRoomReqVO repVO);

    /**
     * 删除投票
     *
     * @param req
     * @return
     */
    @PostMapping("/delete")
    Boolean delete(@Validated VoteDeleteReq req);

    /**
     * 获取投票的信息
     *
     * @param reqVO
     * @return
     */
    @GetMapping("/info")
    VoteInfoRspVO info(@Validated VoteInfoReqVO reqVO);

    /**
     * 投票详情
     *
     * @param reqVO
     * @return
     */
    @GetMapping("/vote-detail")
    List<VoteDetailRspVO> voteDetail(@Validated VoteDetailReqVO reqVO);

    /**
     * 投票绑定房间  前端未直接使用
     *
     * @param reqVO
     * @return
     */
    @PostMapping("/bind-room")
    Boolean bindRoom(@Validated BindRoomReqVO reqVO);

    /**
     * 投票与房间解绑  未使用
     *
     * @param reqVO
     * @return
     */
    @PostMapping("/unbind-room")
    Boolean unBindRoom(@Validated UnBindRoomReqVO reqVO);

    /**
     * 从资源库中选择投票到房间
     *
     * @param reqVO
     * @return
     */
    @PostMapping("/copy")
    CopyRspVO copy(@Validated CopyReqVO reqVO);

    /**
     * 观看端回答投票
     *
     * @param reqVO
     * @return
     */
    @PostMapping("/answer")
    Boolean answer(@Validated AnswerReqVO reqVO);

    /**
     * 发布投票(主播)
     *
     * @param reqVO
     * @return
     */
    @PostMapping("/publish")
    Boolean publish(@Validated PublishReqVO reqVO);


    /**
     * 取消发布投票
     *
     * @param reqVO
     * @return
     */
    @PostMapping("/cancel-publish")
    Boolean cancelPublish(@Validated PublishReqVO reqVO);


    /**
     * 投票结束
     *
     * @param reqVO
     * @return
     */
    @PostMapping("/vote-finish")
    Boolean voteFinish(@Validated FinishReqVO reqVO);


    /**
     * 投票结束后，投票公布结果
     *
     * @param reqVO
     * @return
     */
    @PostMapping("/vote-push")
    Boolean votePush(@Validated PushReqVO reqVO);


    /**
     * 投票中，投票公布结果  投票实时统计结果推送(不发公告)
     *
     * @param reqVO
     * @return
     */
    @PostMapping("/push-statis")
    Boolean pushStatis(@Validated PushStatisReqVO reqVO);


    /**
     * 观众端调用 是否提交过投票
     *
     * @param reqVO
     * @return
     */
    @GetMapping("/check-survey")
    CheckSurveyRspVO checkSurvey(@Validated CheckSurveyReqVO reqVO);

    @PostMapping("/last/vote")
    VotesListRspVO getLastVote(String roomId);
}
